package com.bort.system;

import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;

import java.io.IOException;

public abstract class FxViewLoader {
    protected String url;

    public Parent loadView(){
        try {
           Parent parent = FXMLLoader.load(this.getClass().getResource(url));
           return parent;
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }
}
